/*
 * Copyright 2023, Haiku, Inc. All rights reserved.
 * Distributed under the terms of the MIT License.
 */
#ifndef _KERNEL_ARCH_LOONGARCH64_ARCH_THREAD_TYPES_H_
#define _KERNEL_ARCH_LOONGARCH64_ARCH_THREAD_TYPES_H_

#include <kernel.h>

// LoongArch64 specific thread data structures and definitions

// architecture specific thread info
struct arch_thread
{
    void *fp;              // frame pointer
    void *sp;              // stack pointer
    void *interrupt_stack; // interrupt stack
    void *kernel_stack;    // kernel stack
    void *user_sp;         // user stack pointer
    uint64 thread_id;      // thread ID used in cmpxchg

    // used to track interrupts on this thread
    uint32 interrupts_enabled;
    uint32 page_faults_allowed;

    // saved registers
    uint64 r[32];    // general purpose registers
    uint64 pc;       // program counter
    uint64 csr_era;  // exception return address
    uint64 csr_prmd; // previous mode info
};

struct arch_team
{
    // empty
};

struct arch_fork_arg
{
    // empty
};

#endif /* _KERNEL_ARCH_LOONGARCH64_ARCH_THREAD_TYPES_H_ */